using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VVHANSTA
    {
        public DataRow Convert2VHANSTA(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryVHANSTA(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["VHASA"] = " ".PadRight(2 ); 
         dwReturn["VHAMANDANT"] = " ".PadRight(2 ); 
         dwReturn["VHAJHJJ"] = " ".PadRight(4 ); 
         dwReturn["VHAMM"] = " ".PadRight(2 ); 
         dwReturn["VHALFDNR"] = " ".PadRight(6 ); 
         dwReturn["VHAAENB"] = " ".PadRight(8 ); 
         dwReturn["VHAAEND"] = " ".PadRight(0 ); 
         dwReturn["VHANEUB"] = " ".PadRight(8 ); 
         dwReturn["VHANEUD"] = " ".PadRight(0 ); 
         dwReturn["VHAVB"] = " ".PadRight(3 ); 
         dwReturn["VHABUCHKRS"] = " ".PadRight(3 ); 
         dwReturn["VHAKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["VHALIEFNR"] = " ".PadRight(8 ); 
         dwReturn["VHARENR"] = " ".PadRight(10 ); 
         dwReturn["VHAREPOS"] = " ".PadRight(3 ); 
         dwReturn["VHABEM"] = " ".PadRight(250 ); 
         dwReturn["VHALO"] = " ".PadRight(2 ); 
         dwReturn["VHALAND"] = " ".PadRight(3 ); 
         dwReturn["VHAARTGS"] = " ".PadRight(2 ); 
         dwReturn["VHAVZWEIG"] = " ".PadRight(1 ); 
         dwReturn["VHAURLAND"] = " ".PadRight(3 ); 
         dwReturn["VHAZOLLTNR"] = " ".PadRight(8 ); 
         dwReturn["VHAVERF"] = " ".PadRight(5 ); 
         dwReturn["VHAEIGM"] = " ".PadRight(13 ); 
         dwReturn["VHABMASS"] = " ".PadRight(13 ); 
         dwReturn["VHARWERT"] = " ".PadRight(13 ); 
         dwReturn["VHASWERT"] = " ".PadRight(13 ); 
         dwReturn["VHABMM"] = " ".PadRight(2 ); 
         dwReturn["VHABJJ"] = " ".PadRight(2 ); 
         dwReturn["VHAWAEHRKZ"] = " ".PadRight(1 ); 
         dwReturn["VHAEXRENR"] = " ".PadRight(20 ); 
         dwReturn["VHAZOLLNR"] = " ".PadRight(7 ); 
         dwReturn["VHAFIRMNR"] = " ".PadRight(7 ); 
         dwReturn["VHAURREGION"] = " ".PadRight(2 ); 
         dwReturn["VHASTEUERNR"] = " ".PadRight(11 ); 
         dwReturn["VHAUNTERNR"] = " ".PadRight(3 ); 
         dwReturn["VHASITZVERS"] = " ".PadRight(1 ); 
         dwReturn["VHAREDAT"] = " ".PadRight(0 ); 
         dwReturn["VHABMME"] = " ".PadRight(3 ); 
         dwReturn["VHAFILLER1"] = " ".PadRight(27 ); 
         dwReturn["VHAKOBRA"] = " ".PadRight(1 ); 
         dwReturn["VHAKLAND"] = " ".PadRight(3 ); 
         dwReturn["VHACONTV"] = " ".PadRight(1 ); 
         dwReturn["VHATPMLKZ"] = " ".PadRight(3 ); 
         dwReturn["VHAAZOLLST"] = " ".PadRight(6 ); 
         dwReturn["VHAIURLAND"] = " ".PadRight(2 ); 
         dwReturn["VHAIVZWEIG"] = " ".PadRight(1 ); 
         dwReturn["VHAVERSDAT"] = " ".PadRight(0 ); 
         dwReturn["VHAKUNDNRV"] = " ".PadRight(8 ); 
         dwReturn["VHAADRSLV"] = " ".PadRight(8 ); 
         dwReturn["VHAKUNDNRE"] = " ".PadRight(8 ); 
         dwReturn["VHAADRSLE"] = " ".PadRight(8 ); 
         dwReturn["VHAKCODE"] = " ".PadRight(1 ); 
         dwReturn["VHAVRCHTG"] = " ".PadRight(1 ); 
         dwReturn["VHABEWPFL"] = " ".PadRight(1 ); 
         dwReturn["VHADRVERT"] = " ".PadRight(20 ); 
         dwReturn["VHACBOOKNO"] = " ".PadRight(15 ); 
         dwReturn["VHACITEMNO"] = " ".PadRight(0 ); 
         dwReturn["VHABOOKCOR"] = " ".PadRight(15 ); 
         dwReturn["VHAZOLLST"] = " ".PadRight(6 ); 
         dwReturn["VHAZFORMNR"] = " ".PadRight(10 ); 
         dwReturn["VHAARTST"] = " ".PadRight(1 ); 
         dwReturn["VHARWARTST"] = " ".PadRight(1 ); 
         dwReturn["VHALIEFSCHNR"] = " ".PadRight(10 ); 
         dwReturn["VHACHARGE"] = " ".PadRight(12 ); 
         dwReturn["VHARWART"] = " ".PadRight(20 ); 
         dwReturn["VHARWVAR"] = " ".PadRight(3 ); 
         dwReturn["VHAROHWERT"] = " ".PadRight(0 ); 
         dwReturn["VHAFWKUNDNR"] = " ".PadRight(8 ); 
         dwReturn["VHAFWWERK"] = " ".PadRight(3 ); 
         dwReturn["VHAFWABT"] = " ".PadRight(3 ); 
         dwReturn["VHAFWART"] = " ".PadRight(20 ); 
         dwReturn["VHAFWVAR"] = " ".PadRight(3 ); 
         dwReturn["VHALFMENGE"] = " ".PadRight(0 ); 
         dwReturn["VHABUSIMODE"] = " ".PadRight(3 ); 
         dwReturn["VHAZUSTAND"] = " ".PadRight(4 ); 
         dwReturn["VHALAEAEND"] = " ".PadRight(0 ); 
         dwReturn["VHARWMENGE"] = " ".PadRight(0 ); 
         dwReturn["VHALIEFBED"] = " ".PadRight(3 ); 
         dwReturn["VHABRTGEW"] = " ".PadRight(0 ); 
         dwReturn["VHANETGEW"] = " ".PadRight(0 ); 
         dwReturn["VHAWAEHRSL"] = " ".PadRight(3 ); 
         dwReturn["VHAKURS"] = " ".PadRight(0 ); 
         dwReturn["VHABETRAG"] = " ".PadRight(0 ); 
         dwReturn["VHALIEFSCH"] = " ".PadRight(0 ); 
         dwReturn["VHAFILLER2"] = " ".PadRight(54 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapVHANSTA(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveVHANSTA(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryVHANSTA(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapVHANSTA(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertVHANSTA(dwLocal, ITXDBVERSION);
            }
            UpdateVHANSTA(dwLocal);
        }
        public void InsertVHANSTA(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO VHANSTA(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryVHANSTA(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM VHANSTA WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM VHANSTA  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "VHANSTA";
            Return = Result;
            return Return;
        }
        public void DeleteVHANSTA(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM VHANSTA   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateVHANSTA(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE VHANSTA SET "
                    +"VHASA= :VHASA,"
                    +"VHAMANDANT= :VHAMANDANT,"
                    +"VHAJHJJ= :VHAJHJJ,"
                    +"VHAMM= :VHAMM,"
                    +"VHALFDNR= :VHALFDNR,"
                    +"VHAAENB= :VHAAENB,"
                    +"VHAAEND= :VHAAEND,"
                    +"VHANEUB= :VHANEUB,"
                    +"VHANEUD= :VHANEUD,"
                    +"VHAVB= :VHAVB,"
                    +"VHABUCHKRS= :VHABUCHKRS,"
                    +"VHAKUNDNR= :VHAKUNDNR,"
                    +"VHALIEFNR= :VHALIEFNR,"
                    +"VHARENR= :VHARENR,"
                    +"VHAREPOS= :VHAREPOS,"
                    +"VHABEM= :VHABEM,"
                    +"VHALO= :VHALO,"
                    +"VHALAND= :VHALAND,"
                    +"VHAARTGS= :VHAARTGS,"
                    +"VHAVZWEIG= :VHAVZWEIG,"
                    +"VHAURLAND= :VHAURLAND,"
                    +"VHAZOLLTNR= :VHAZOLLTNR,"
                    +"VHAVERF= :VHAVERF,"
                    +"VHAEIGM= :VHAEIGM,"
                    +"VHABMASS= :VHABMASS,"
                    +"VHARWERT= :VHARWERT,"
                    +"VHASWERT= :VHASWERT,"
                    +"VHABMM= :VHABMM,"
                    +"VHABJJ= :VHABJJ,"
                    +"VHAWAEHRKZ= :VHAWAEHRKZ,"
                    +"VHAEXRENR= :VHAEXRENR,"
                    +"VHAZOLLNR= :VHAZOLLNR,"
                    +"VHAFIRMNR= :VHAFIRMNR,"
                    +"VHAURREGION= :VHAURREGION,"
                    +"VHASTEUERNR= :VHASTEUERNR,"
                    +"VHAUNTERNR= :VHAUNTERNR,"
                    +"VHASITZVERS= :VHASITZVERS,"
                    +"VHAREDAT= :VHAREDAT,"
                    +"VHABMME= :VHABMME,"
                    +"VHAFILLER1= :VHAFILLER1,"
                    +"VHAKOBRA= :VHAKOBRA,"
                    +"VHAKLAND= :VHAKLAND,"
                    +"VHACONTV= :VHACONTV,"
                    +"VHATPMLKZ= :VHATPMLKZ,"
                    +"VHAAZOLLST= :VHAAZOLLST,"
                    +"VHAIURLAND= :VHAIURLAND,"
                    +"VHAIVZWEIG= :VHAIVZWEIG,"
                    +"VHAVERSDAT= :VHAVERSDAT,"
                    +"VHAKUNDNRV= :VHAKUNDNRV,"
                    +"VHAADRSLV= :VHAADRSLV,"
                    +"VHAKUNDNRE= :VHAKUNDNRE,"
                    +"VHAADRSLE= :VHAADRSLE,"
                    +"VHAKCODE= :VHAKCODE,"
                    +"VHAVRCHTG= :VHAVRCHTG,"
                    +"VHABEWPFL= :VHABEWPFL,"
                    +"VHADRVERT= :VHADRVERT,"
                    +"VHACBOOKNO= :VHACBOOKNO,"
                    +"VHACITEMNO= :VHACITEMNO,"
                    +"VHABOOKCOR= :VHABOOKCOR,"
                    +"VHAZOLLST= :VHAZOLLST,"
                    +"VHAZFORMNR= :VHAZFORMNR,"
                    +"VHAARTST= :VHAARTST,"
                    +"VHARWARTST= :VHARWARTST,"
                    +"VHALIEFSCHNR= :VHALIEFSCHNR,"
                    +"VHACHARGE= :VHACHARGE,"
                    +"VHARWART= :VHARWART,"
                    +"VHARWVAR= :VHARWVAR,"
                    +"VHAROHWERT= :VHAROHWERT,"
                    +"VHAFWKUNDNR= :VHAFWKUNDNR,"
                    +"VHAFWWERK= :VHAFWWERK,"
                    +"VHAFWABT= :VHAFWABT,"
                    +"VHAFWART= :VHAFWART,"
                    +"VHAFWVAR= :VHAFWVAR,"
                    +"VHALFMENGE= :VHALFMENGE,"
                    +"VHABUSIMODE= :VHABUSIMODE,"
                    +"VHAZUSTAND= :VHAZUSTAND,"
                    +"VHALAEAEND= :VHALAEAEND,"
                    +"VHARWMENGE= :VHARWMENGE,"
                    +"VHALIEFBED= :VHALIEFBED,"
                    +"VHABRTGEW= :VHABRTGEW,"
                    +"VHANETGEW= :VHANETGEW,"
                    +"VHAWAEHRSL= :VHAWAEHRSL,"
                    +"VHAKURS= :VHAKURS,"
                    +"VHABETRAG= :VHABETRAG,"
                    +"VHALIEFSCH= :VHALIEFSCH,"
                    +"VHAFILLER2= :VHAFILLER2,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("VHASA", OracleType.NVarChar).Value = dwData["VHASA"].ToString(); 
          or1.Parameters.Add("VHAMANDANT", OracleType.NVarChar).Value = dwData["VHAMANDANT"].ToString(); 
          or1.Parameters.Add("VHAJHJJ", OracleType.NVarChar).Value = dwData["VHAJHJJ"].ToString(); 
          or1.Parameters.Add("VHAMM", OracleType.NVarChar).Value = dwData["VHAMM"].ToString(); 
          or1.Parameters.Add("VHALFDNR", OracleType.NVarChar).Value = dwData["VHALFDNR"].ToString(); 
          or1.Parameters.Add("VHAAENB", OracleType.NVarChar).Value = dwData["VHAAENB"].ToString(); 
          or1.Parameters.Add("VHAAEND", OracleType.NVarChar).Value = dwData["VHAAEND"].ToString(); 
          or1.Parameters.Add("VHANEUB", OracleType.NVarChar).Value = dwData["VHANEUB"].ToString(); 
          or1.Parameters.Add("VHANEUD", OracleType.NVarChar).Value = dwData["VHANEUD"].ToString(); 
          or1.Parameters.Add("VHAVB", OracleType.NVarChar).Value = dwData["VHAVB"].ToString(); 
          or1.Parameters.Add("VHABUCHKRS", OracleType.NVarChar).Value = dwData["VHABUCHKRS"].ToString(); 
          or1.Parameters.Add("VHAKUNDNR", OracleType.NVarChar).Value = dwData["VHAKUNDNR"].ToString(); 
          or1.Parameters.Add("VHALIEFNR", OracleType.NVarChar).Value = dwData["VHALIEFNR"].ToString(); 
          or1.Parameters.Add("VHARENR", OracleType.NVarChar).Value = dwData["VHARENR"].ToString(); 
          or1.Parameters.Add("VHAREPOS", OracleType.NVarChar).Value = dwData["VHAREPOS"].ToString(); 
          or1.Parameters.Add("VHABEM", OracleType.NVarChar).Value = dwData["VHABEM"].ToString(); 
          or1.Parameters.Add("VHALO", OracleType.NVarChar).Value = dwData["VHALO"].ToString(); 
          or1.Parameters.Add("VHALAND", OracleType.NVarChar).Value = dwData["VHALAND"].ToString(); 
          or1.Parameters.Add("VHAARTGS", OracleType.NVarChar).Value = dwData["VHAARTGS"].ToString(); 
          or1.Parameters.Add("VHAVZWEIG", OracleType.NVarChar).Value = dwData["VHAVZWEIG"].ToString(); 
          or1.Parameters.Add("VHAURLAND", OracleType.NVarChar).Value = dwData["VHAURLAND"].ToString(); 
          or1.Parameters.Add("VHAZOLLTNR", OracleType.NVarChar).Value = dwData["VHAZOLLTNR"].ToString(); 
          or1.Parameters.Add("VHAVERF", OracleType.NVarChar).Value = dwData["VHAVERF"].ToString(); 
          or1.Parameters.Add("VHAEIGM", OracleType.NVarChar).Value = dwData["VHAEIGM"].ToString(); 
          or1.Parameters.Add("VHABMASS", OracleType.NVarChar).Value = dwData["VHABMASS"].ToString(); 
          or1.Parameters.Add("VHARWERT", OracleType.NVarChar).Value = dwData["VHARWERT"].ToString(); 
          or1.Parameters.Add("VHASWERT", OracleType.NVarChar).Value = dwData["VHASWERT"].ToString(); 
          or1.Parameters.Add("VHABMM", OracleType.NVarChar).Value = dwData["VHABMM"].ToString(); 
          or1.Parameters.Add("VHABJJ", OracleType.NVarChar).Value = dwData["VHABJJ"].ToString(); 
          or1.Parameters.Add("VHAWAEHRKZ", OracleType.NVarChar).Value = dwData["VHAWAEHRKZ"].ToString(); 
          or1.Parameters.Add("VHAEXRENR", OracleType.NVarChar).Value = dwData["VHAEXRENR"].ToString(); 
          or1.Parameters.Add("VHAZOLLNR", OracleType.NVarChar).Value = dwData["VHAZOLLNR"].ToString(); 
          or1.Parameters.Add("VHAFIRMNR", OracleType.NVarChar).Value = dwData["VHAFIRMNR"].ToString(); 
          or1.Parameters.Add("VHAURREGION", OracleType.NVarChar).Value = dwData["VHAURREGION"].ToString(); 
          or1.Parameters.Add("VHASTEUERNR", OracleType.NVarChar).Value = dwData["VHASTEUERNR"].ToString(); 
          or1.Parameters.Add("VHAUNTERNR", OracleType.NVarChar).Value = dwData["VHAUNTERNR"].ToString(); 
          or1.Parameters.Add("VHASITZVERS", OracleType.NVarChar).Value = dwData["VHASITZVERS"].ToString(); 
          or1.Parameters.Add("VHAREDAT", OracleType.NVarChar).Value = dwData["VHAREDAT"].ToString(); 
          or1.Parameters.Add("VHABMME", OracleType.NVarChar).Value = dwData["VHABMME"].ToString(); 
          or1.Parameters.Add("VHAFILLER1", OracleType.NVarChar).Value = dwData["VHAFILLER1"].ToString(); 
          or1.Parameters.Add("VHAKOBRA", OracleType.NVarChar).Value = dwData["VHAKOBRA"].ToString(); 
          or1.Parameters.Add("VHAKLAND", OracleType.NVarChar).Value = dwData["VHAKLAND"].ToString(); 
          or1.Parameters.Add("VHACONTV", OracleType.NVarChar).Value = dwData["VHACONTV"].ToString(); 
          or1.Parameters.Add("VHATPMLKZ", OracleType.NVarChar).Value = dwData["VHATPMLKZ"].ToString(); 
          or1.Parameters.Add("VHAAZOLLST", OracleType.NVarChar).Value = dwData["VHAAZOLLST"].ToString(); 
          or1.Parameters.Add("VHAIURLAND", OracleType.NVarChar).Value = dwData["VHAIURLAND"].ToString(); 
          or1.Parameters.Add("VHAIVZWEIG", OracleType.NVarChar).Value = dwData["VHAIVZWEIG"].ToString(); 
          or1.Parameters.Add("VHAVERSDAT", OracleType.NVarChar).Value = dwData["VHAVERSDAT"].ToString(); 
          or1.Parameters.Add("VHAKUNDNRV", OracleType.NVarChar).Value = dwData["VHAKUNDNRV"].ToString(); 
          or1.Parameters.Add("VHAADRSLV", OracleType.NVarChar).Value = dwData["VHAADRSLV"].ToString(); 
          or1.Parameters.Add("VHAKUNDNRE", OracleType.NVarChar).Value = dwData["VHAKUNDNRE"].ToString(); 
          or1.Parameters.Add("VHAADRSLE", OracleType.NVarChar).Value = dwData["VHAADRSLE"].ToString(); 
          or1.Parameters.Add("VHAKCODE", OracleType.NVarChar).Value = dwData["VHAKCODE"].ToString(); 
          or1.Parameters.Add("VHAVRCHTG", OracleType.NVarChar).Value = dwData["VHAVRCHTG"].ToString(); 
          or1.Parameters.Add("VHABEWPFL", OracleType.NVarChar).Value = dwData["VHABEWPFL"].ToString(); 
          or1.Parameters.Add("VHADRVERT", OracleType.NVarChar).Value = dwData["VHADRVERT"].ToString(); 
          or1.Parameters.Add("VHACBOOKNO", OracleType.NVarChar).Value = dwData["VHACBOOKNO"].ToString(); 
          or1.Parameters.Add("VHACITEMNO", OracleType.NVarChar).Value = dwData["VHACITEMNO"].ToString(); 
          or1.Parameters.Add("VHABOOKCOR", OracleType.NVarChar).Value = dwData["VHABOOKCOR"].ToString(); 
          or1.Parameters.Add("VHAZOLLST", OracleType.NVarChar).Value = dwData["VHAZOLLST"].ToString(); 
          or1.Parameters.Add("VHAZFORMNR", OracleType.NVarChar).Value = dwData["VHAZFORMNR"].ToString(); 
          or1.Parameters.Add("VHAARTST", OracleType.NVarChar).Value = dwData["VHAARTST"].ToString(); 
          or1.Parameters.Add("VHARWARTST", OracleType.NVarChar).Value = dwData["VHARWARTST"].ToString(); 
          or1.Parameters.Add("VHALIEFSCHNR", OracleType.NVarChar).Value = dwData["VHALIEFSCHNR"].ToString(); 
          or1.Parameters.Add("VHACHARGE", OracleType.NVarChar).Value = dwData["VHACHARGE"].ToString(); 
          or1.Parameters.Add("VHARWART", OracleType.NVarChar).Value = dwData["VHARWART"].ToString(); 
          or1.Parameters.Add("VHARWVAR", OracleType.NVarChar).Value = dwData["VHARWVAR"].ToString(); 
          or1.Parameters.Add("VHAROHWERT", OracleType.NVarChar).Value = dwData["VHAROHWERT"].ToString(); 
          or1.Parameters.Add("VHAFWKUNDNR", OracleType.NVarChar).Value = dwData["VHAFWKUNDNR"].ToString(); 
          or1.Parameters.Add("VHAFWWERK", OracleType.NVarChar).Value = dwData["VHAFWWERK"].ToString(); 
          or1.Parameters.Add("VHAFWABT", OracleType.NVarChar).Value = dwData["VHAFWABT"].ToString(); 
          or1.Parameters.Add("VHAFWART", OracleType.NVarChar).Value = dwData["VHAFWART"].ToString(); 
          or1.Parameters.Add("VHAFWVAR", OracleType.NVarChar).Value = dwData["VHAFWVAR"].ToString(); 
          or1.Parameters.Add("VHALFMENGE", OracleType.NVarChar).Value = dwData["VHALFMENGE"].ToString(); 
          or1.Parameters.Add("VHABUSIMODE", OracleType.NVarChar).Value = dwData["VHABUSIMODE"].ToString(); 
          or1.Parameters.Add("VHAZUSTAND", OracleType.NVarChar).Value = dwData["VHAZUSTAND"].ToString(); 
          or1.Parameters.Add("VHALAEAEND", OracleType.NVarChar).Value = dwData["VHALAEAEND"].ToString(); 
          or1.Parameters.Add("VHARWMENGE", OracleType.NVarChar).Value = dwData["VHARWMENGE"].ToString(); 
          or1.Parameters.Add("VHALIEFBED", OracleType.NVarChar).Value = dwData["VHALIEFBED"].ToString(); 
          or1.Parameters.Add("VHABRTGEW", OracleType.NVarChar).Value = dwData["VHABRTGEW"].ToString(); 
          or1.Parameters.Add("VHANETGEW", OracleType.NVarChar).Value = dwData["VHANETGEW"].ToString(); 
          or1.Parameters.Add("VHAWAEHRSL", OracleType.NVarChar).Value = dwData["VHAWAEHRSL"].ToString(); 
          or1.Parameters.Add("VHAKURS", OracleType.NVarChar).Value = dwData["VHAKURS"].ToString(); 
          or1.Parameters.Add("VHABETRAG", OracleType.NVarChar).Value = dwData["VHABETRAG"].ToString(); 
          or1.Parameters.Add("VHALIEFSCH", OracleType.NVarChar).Value = dwData["VHALIEFSCH"].ToString(); 
          or1.Parameters.Add("VHAFILLER2", OracleType.NVarChar).Value = dwData["VHAFILLER2"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
